import java.util.Arrays;

public class Practice1 {
    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5,6};
        fun(arr);
        System.out.println(Arrays.toString(arr));
    }
    public static void fun(int[] arr){
        int left = 0;
        int right = arr.length-1;

        while (left < right){
            if ( arr[left] % 2 == 0 && arr[right] % 2 !=0){
                int temp = arr[left];
                arr[left] = arr[right];
                arr[right] = temp;
            }
            left++;
            right--;
        }
    }
}
/*    public static void main(String[] args) {
        int[] arr = new int[]{1,2,3,4};
        System.out.println(fun(arr));
    }
    public static int fun(int[] arr){
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            sum += arr[i];
        }
        return sum;
    }
}*/
/*    public static void main(String[] args) {
        int[] arr = new int[]{1,2,3};
        transform(arr);
        System.out.println(Arrays.toString(arr));
    }
    public static void transform(int[] arr){
        for (int i = 0; i < arr.length; i++) {
            arr[i] = arr[i] * 2;
        }
    }
}*/
/*    public static void main(String[] args) {
        int[] arr = new int[100];
        for (int i = 0; i < 100; i++) {
            arr[i] = i+1;
        }
        System.out.println(Arrays.toString(arr));
    }
}*/
